
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Binder详解 · Aivin开发笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Aivin">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../../styles/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Handler详解.html" />
    
    
    <link rel="prev" href="../通信方式/通信方式详解.html" />
    

    
        <link rel="shortcut icon" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    首页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../doc/常用网站.html">
            
                <a href="../doc/常用网站.html">
            
                    
                    常用网站
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../常用软件/常用软件和框架.html">
            
                <a href="../常用软件/常用软件和框架.html">
            
                    
                    常用软件和框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../doc/开发规范.html">
            
                <a href="../doc/开发规范.html">
            
                    
                    开发规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../doc/开源软件.html">
            
                <a href="../doc/开源软件.html">
            
                    
                    开源软件和框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../doc/Android常用代码.html">
            
                <a href="../doc/Android常用代码.html">
            
                    
                    Android常用代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../源码阅读/源码阅读配置.html">
            
                <a href="../源码阅读/源码阅读配置.html">
            
                    
                    源码阅读
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../源码阅读/其他框架源码.html">
            
                <a href="../源码阅读/其他框架源码.html">
            
                    
                    其他框架源码
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../产品经理/产品经理.html">
            
                <a href="../产品经理/产品经理.html">
            
                    
                    产品经理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../设计模式/设计模式.html">
            
                <a href="../设计模式/设计模式.html">
            
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../设计模式/设计模式.html">
            
                <a href="../设计模式/设计模式.html">
            
                    
                    设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../设计模式/模式详解.html">
            
                <a href="../设计模式/模式详解.html">
            
                    
                    模式详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../设计模式/mvc等.html">
            
                <a href="../设计模式/mvc等.html">
            
                    
                    mvc等
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../数据结构/常用数据结构.html">
            
                <a href="../数据结构/常用数据结构.html">
            
                    
                    基本算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../数据结构/常用数据结构.html">
            
                <a href="../数据结构/常用数据结构.html">
            
                    
                    常用数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../常用算法/算法术语.html">
            
                <a href="../常用算法/算法术语.html">
            
                    
                    算法术语
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../常用算法/排序算法.html">
            
                <a href="../常用算法/排序算法.html">
            
                    
                    排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../常用算法/查找算法.html">
            
                <a href="../常用算法/查找算法.html">
            
                    
                    查找算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../常用算法/大数相加.html">
            
                <a href="../常用算法/大数相加.html">
            
                    
                    大数相加
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../常用算法/集合的所有子集.html">
            
                <a href="../常用算法/集合的所有子集.html">
            
                    
                    获得集合的所有子集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" data-path="../常用算法/扫描线种子填充算法.html">
            
                <a href="../常用算法/扫描线种子填充算法.html">
            
                    
                    扫描线种子填充算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.8" data-path="../常用算法/其他算法.html">
            
                <a href="../常用算法/其他算法.html">
            
                    
                    其他算法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../java基础/原码补码反码.html">
            
                <a href="../java基础/原码补码反码.html">
            
                    
                    Java部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../java基础/原码补码反码.html">
            
                <a href="../java基础/原码补码反码.html">
            
                    
                    原码补码反码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../java基础/java常用代码.html">
            
                <a href="../java基础/java常用代码.html">
            
                    
                    java常用代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../java基础/JVM详解.html">
            
                <a href="../java基础/JVM详解.html">
            
                    
                    JVM详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../java基础/类加载机制.html">
            
                <a href="../java基础/类加载机制.html">
            
                    
                    类加载机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../java基础/内存模型.html">
            
                <a href="../java基础/内存模型.html">
            
                    
                    内存模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../java基础/GC机制.html">
            
                <a href="../java基础/GC机制.html">
            
                    
                    GC机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../java基础/对象内存布局.html">
            
                <a href="../java基础/对象内存布局.html">
            
                    
                    对象内存布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../java基础/继承多态.html">
            
                <a href="../java基础/继承多态.html">
            
                    
                    继承和多态
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../java基础/相等判断.html">
            
                <a href="../java基础/相等判断.html">
            
                    
                    相等判断
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../java基础/Java容器类.html">
            
                <a href="../java基础/Java容器类.html">
            
                    
                    Java容器类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.11" data-path="../java基础/Java枚举.html">
            
                <a href="../java基础/Java枚举.html">
            
                    
                    Java枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.12" data-path="../java基础/自定义异常.html">
            
                <a href="../java基础/自定义异常.html">
            
                    
                    自定义异常
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.13" data-path="../java基础/深度拷贝.html">
            
                <a href="../java基础/深度拷贝.html">
            
                    
                    深度拷贝
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.14" data-path="../java基础/泛型详解.html">
            
                <a href="../java基础/泛型详解.html">
            
                    
                    泛型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.15" data-path="../java基础/线程详解.html">
            
                <a href="../java基础/线程详解.html">
            
                    
                    线程详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.16" data-path="../java基础/java注解.html">
            
                <a href="../java基础/java注解.html">
            
                    
                    注解详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.17" data-path="../java基础/数据解析.html">
            
                <a href="../java基础/数据解析.html">
            
                    
                    数据解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.18" data-path="../java基础/java8新特性.html">
            
                <a href="../java基础/java8新特性.html">
            
                    
                    Java8新特性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="android零散知识.html">
            
                <a href="android零散知识.html">
            
                    
                    Android部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="基础控件使用.html">
            
                <a href="基础控件使用.html">
            
                    
                    基础控件使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="android零散知识.html">
            
                <a href="android零散知识.html">
            
                    
                    Android零散知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="android坐标体系.html">
            
                <a href="android坐标体系.html">
            
                    
                    Android坐标体系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.4" data-path="APP的启动流程.html">
            
                <a href="APP的启动流程.html">
            
                    
                    APP启动流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.5" data-path="View加载流程.html">
            
                <a href="View加载流程.html">
            
                    
                    View加载流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.6" data-path="事件分发机制.html">
            
                <a href="事件分发机制.html">
            
                    
                    事件分发机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.7" data-path="控件绘制流程.html">
            
                <a href="控件绘制流程.html">
            
                    
                    控件绘制流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.8" data-path="常用shape.html">
            
                <a href="常用shape.html">
            
                    
                    常用shape
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.9" data-path="进程通信.html">
            
                <a href="进程通信.html">
            
                    
                    进程通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.10" data-path="../通信方式/通信方式详解.html">
            
                <a href="../通信方式/通信方式详解.html">
            
                    
                    通信方式详解
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.12.11" data-path="Binder详解.html">
            
                <a href="Binder详解.html">
            
                    
                    Binder详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.12" data-path="Handler详解.html">
            
                <a href="Handler详解.html">
            
                    
                    Handle详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.13" data-path="Fragment详解.html">
            
                <a href="Fragment详解.html">
            
                    
                    Fragment详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.14" data-path="Activity详解.html">
            
                <a href="Activity详解.html">
            
                    
                    Activity详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.15" data-path="BroadcastReceiver.html">
            
                <a href="BroadcastReceiver.html">
            
                    
                    BroadcastReceiver详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.16" data-path="Service服务.html">
            
                <a href="Service服务.html">
            
                    
                    Service详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.17" data-path="动画详解.html">
            
                <a href="动画详解.html">
            
                    
                    动画详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.18" data-path="屏幕刷新机制.html">
            
                <a href="屏幕刷新机制.html">
            
                    
                    屏幕刷新机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.19" data-path="屏幕适配.html">
            
                <a href="屏幕适配.html">
            
                    
                    屏幕适配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.20" data-path="图片加载详解.html">
            
                <a href="图片加载详解.html">
            
                    
                    图片加载详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.21" data-path="WebView详解.html">
            
                <a href="WebView详解.html">
            
                    
                    WebView详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.22" data-path="沉浸式.html">
            
                <a href="沉浸式.html">
            
                    
                    沉浸式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.23" data-path="相机模块.html">
            
                <a href="相机模块.html">
            
                    
                    相机模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.24" data-path="地图模块.html">
            
                <a href="地图模块.html">
            
                    
                    地图模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.25" data-path="Androidstudio插件开发.html">
            
                <a href="Androidstudio插件开发.html">
            
                    
                    Androidstudio插件开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.26" data-path="Apk插件化开发.html">
            
                <a href="Apk插件化开发.html">
            
                    
                    Apk插件化开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.27" data-path="App组件化开发.html">
            
                <a href="App组件化开发.html">
            
                    
                    App组件化开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.28" data-path="sdk开发.html">
            
                <a href="sdk开发.html">
            
                    
                    sdk开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.29" data-path="APP优化.html">
            
                <a href="APP优化.html">
            
                    
                    APP优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.30" data-path="项目参数配置.html">
            
                <a href="项目参数配置.html">
            
                    
                    项目参数配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.31" data-path="App发布.html">
            
                <a href="App发布.html">
            
                    
                    App发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.32" data-path="Android外挂.html">
            
                <a href="Android外挂.html">
            
                    
                    Android外挂
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.33" data-path="Android字节码插桩.html">
            
                <a href="Android字节码插桩.html">
            
                    
                    Android字节码插桩
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.34" data-path="智能家居.html">
            
                <a href="智能家居.html">
            
                    
                    智能家居
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../python/python基础.html">
            
                <a href="../python/python基础.html">
            
                    
                    python部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../python/python基础.html">
            
                <a href="../python/python基础.html">
            
                    
                    python基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../python/python爬虫.html">
            
                <a href="../python/python爬虫.html">
            
                    
                    python爬虫
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../gradle/Groovy.html">
            
                <a href="../gradle/Groovy.html">
            
                    
                    Groovy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../kotlin/kotlin部分.html">
            
                <a href="../kotlin/kotlin部分.html">
            
                    
                    kotlin部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../flutter/flutter部分.html">
            
                <a href="../flutter/flutter部分.html">
            
                    
                    flutter部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../native/ccpp.html">
            
                <a href="../native/ccpp.html">
            
                    
                    native部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="../native/Linux.html">
            
                <a href="../native/Linux.html">
            
                    
                    Linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="../native/ccpp.html">
            
                <a href="../native/ccpp.html">
            
                    
                    cCpp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.3" data-path="../native/NDK.html">
            
                <a href="../native/NDK.html">
            
                    
                    NDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.4" data-path="../native/系统编译剪裁.html">
            
                <a href="../native/系统编译剪裁.html">
            
                    
                    系统编译剪裁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5" data-path="../native/音视频.html">
            
                <a href="../native/音视频.html">
            
                    
                    音视频
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.6" data-path="../native/音视频第三方库.html">
            
                <a href="../native/音视频第三方库.html">
            
                    
                    音视频第三方库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.7" data-path="../native/相关代码.html">
            
                <a href="../native/相关代码.html">
            
                    
                    相关代码
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="../server/服务器部分.html">
            
                <a href="../server/服务器部分.html">
            
                    
                    服务器部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="../webDev/web部分.html">
            
                <a href="../webDev/web部分.html">
            
                    
                    web部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="../人工智能/人工智能相关概念.html">
            
                <a href="../人工智能/人工智能相关概念.html">
            
                    
                    人工智能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="../面试真题/极飞.html">
            
                <a href="../面试真题/极飞.html">
            
                    
                    面试真题
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Binder详解</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#binder&#x8BE6;&#x89E3;"><b>1. </b>Binder&#x8BE6;&#x89E3;</a></li><ul><li><span class="title-icon "></span><a href="#&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x91C7;&#x7528;binder"><b>1.1. </b>&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x91C7;&#x7528;Binder</a></li><li><span class="title-icon "></span><a href="#binder-&#x67B6;&#x6784;"><b>1.2. </b>Binder &#x67B6;&#x6784;</a></li><ul><li><span class="title-icon "></span><a href="#binder-client"><b>1.2.1. </b>Binder Client</a></li><li><span class="title-icon "></span><a href="#binder-server"><b>1.2.2. </b>Binder Server</a></li><li><span class="title-icon "></span><a href="#servicemanager"><b>1.2.3. </b>ServiceManager</a></li><li><span class="title-icon "></span><a href="#binder-driver"><b>1.2.4. </b>Binder Driver</a></li></ul></ul><li><span class="title-icon "></span><a href="#&#x76F8;&#x5173;-&#x7C7B;&#x3001;&#x65B9;&#x6CD5;-&#x3001;&#x6982;&#x5FF5;"><b>2. </b>&#x76F8;&#x5173; &#x7C7B;&#x3001;&#x65B9;&#x6CD5; &#x3001;&#x6982;&#x5FF5;</a></li><ul><li><span class="title-icon "></span><a href="#binder&#x5B9E;&#x4F53;"><b>2.1. </b>Binder&#x5B9E;&#x4F53;</a></li><li><span class="title-icon "></span><a href="#&#x5B9E;&#x540D;-binder"><b>2.2. </b>&#x5B9E;&#x540D; Binder</a></li><li><span class="title-icon "></span><a href="#&#x533F;&#x540D;-binder"><b>2.3. </b>&#x533F;&#x540D; Binder</a></li><li><span class="title-icon "></span><a href="#binder&#x5F15;&#x7528;"><b>2.4. </b>Binder&#x5F15;&#x7528;</a></li><li><span class="title-icon "></span><a href="#0&#x53F7;&#x5F15;&#x7528;"><b>2.5. </b>0&#x53F7;&#x5F15;&#x7528;</a></li></ul><li><span class="title-icon "></span><a href="#&#x4E3A;&#x4EC0;&#x4E48;binder&#x53EA;&#x8FDB;&#x884C;&#x4E86;&#x4E00;&#x6B21;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#xFF1F;-&#x3001;mmap"><b>3. </b>&#x4E3A;&#x4EC0;&#x4E48;Binder&#x53EA;&#x8FDB;&#x884C;&#x4E86;&#x4E00;&#x6B21;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#xFF1F; &#x3001;mmap()</a></li><li><span class="title-icon "></span><a href="#binder-&#x600E;&#x4E48;&#x9A8C;&#x8BC1;-pid---&#x6BD4;&#x4F20;&#x7EDF;-&#x9A8C;&#x8BC1;&#x65B9;&#x5F0F;-&#x66F4;&#x5B89;&#x5168;"><b>4. </b>binder &#x600E;&#x4E48;&#x9A8C;&#x8BC1; pid  ( &#x6BD4;&#x4F20;&#x7EDF; &#x9A8C;&#x8BC1;&#x65B9;&#x5F0F; &#x66F4;&#x5B89;&#x5168;)</a></li><li><span class="title-icon "></span><a href="#binder&#x901A;&#x4FE1;&#x547D;&#x4EE4;&#x5B57;"><b>5. </b>Binder&#x901A;&#x4FE1;&#x547D;&#x4EE4;&#x5B57;</a></li><li><span class="title-icon "></span><a href="#binder-&#x63A5;&#x6536;&#x53D1;&#x9001;-&#x6570;&#x636E;&#x5305;&#x7684;&#x6807;&#x51C6;&#x683C;&#x5F0F;"><b>6. </b>Binder &#x63A5;&#x6536;/&#x53D1;&#x9001; &#x6570;&#x636E;&#x5305;&#x7684;&#x6807;&#x51C6;&#x683C;&#x5F0F;</a></li><li><span class="title-icon "></span><a href="#&#x8865;&#x5145;&#x4E00;&#x4E9B;-&#x67B6;&#x6784;&#x56FE;"><b>7. </b>&#x8865;&#x5145;&#x4E00;&#x4E9B; &#x67B6;&#x6784;&#x56FE;</a></li><ul><li><span class="title-icon "></span><a href="#binder-&#x901A;&#x4FE1;&#x6A21;&#x578B;&#x3001;-binder-&#x67B6;&#x6784;"><b>7.1. </b>Binder &#x901A;&#x4FE1;&#x6A21;&#x578B;&#x3001; Binder &#x67B6;&#x6784;</a></li><li><span class="title-icon "></span><a href="#binder-&#x673A;&#x5236;"><b>7.2. </b>Binder &#x673A;&#x5236;</a></li><li><span class="title-icon "></span><a href="#binder-&#x9A71;&#x52A8;"><b>7.3. </b>Binder &#x9A71;&#x52A8;</a></li><li><span class="title-icon "></span><a href="#binder-&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;"><b>7.4. </b>Binder &#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;</a></li><li><span class="title-icon "></span><a href="#servicemanager&#x542F;&#x52A8;"><b>7.5. </b>ServiceManager&#x542F;&#x52A8;</a></li><li><span class="title-icon "></span><a href="#servicemanager-&#x6CE8;&#x518C;&#x670D;&#x52A1;"><b>7.6. </b>ServiceManager &#x6CE8;&#x518C;&#x670D;&#x52A1;</a></li><li><span class="title-icon "></span><a href="#servicemanager-&#x83B7;&#x53D6;&#x670D;&#x52A1;"><b>7.7. </b>ServiceManager &#x83B7;&#x53D6;&#x670D;&#x52A1;</a></li><li><span class="title-icon "></span><a href="#&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x5B8C;&#x6574;&#x901A;&#x8BAF;"><b>7.8. </b>&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x5B8C;&#x6574;&#x901A;&#x8BAF;</a></li></ul></ul></div><a href="#binder&#x8BE6;&#x89E3;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="binder&#x8BE6;&#x89E3;"><a name="binder&#x8BE6;&#x89E3;" class="anchor-navigation-ex-anchor" href="#binder&#x8BE6;&#x89E3;"><i class="fa fa-link" aria-hidden="true"></i></a>1. Binder&#x8BE6;&#x89E3;</h1>
<pre><code class="lang-text">&#x4ECE;&#x82F1;&#x6587;&#x5B57;&#x9762;&#x4E0A;&#x610F;&#x601D;&#x770B;&#xFF0C;Binder &#x5177;&#x6709;&#x7C98;&#x7ED3;&#x5242;&#x7684;&#x610F;&#x601D;&#xFF0C;&#x90A3;&#x4E48;&#x5B83;&#x628A;&#x4EC0;&#x4E48;&#x4E1C;&#x897F;&#x7C98;&#x7ED3;&#x5728;&#x4E00;&#x8D77;&#x5462;&#xFF1F;
&#x5728;Android&#x7CFB;&#x7EDF;&#x7684;Binder&#x673A;&#x5236;&#x4E2D;&#xFF0C;Binder&#x7531; Client&#x3001;Server&#x3001;Service Manager &#x548C;Binder&#x9A71;&#x52A8;&#x7EC4;&#x6210;&#x3002;
Binder&#x5C31;&#x662F;&#x4E00;&#x79CD;&#x628A;&#x8FD9;&#x56DB;&#x4E2A;&#x7EC4;&#x4EF6;&#x7C98;&#x5408;&#x5728;&#x4E00;&#x8D77;&#x7684;&#x7C98;&#x7ED3;&#x5242;&#x4E86;&#x3002;
</code></pre>
<h2 id="&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x91C7;&#x7528;binder"><a name="&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x91C7;&#x7528;binder" class="anchor-navigation-ex-anchor" href="#&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x91C7;&#x7528;binder"><i class="fa fa-link" aria-hidden="true"></i></a>1.1. &#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x91C7;&#x7528;Binder</h2>
<pre><code class="lang-text">Linux &#x73B0;&#x6709;&#x7684;&#x8FDB;&#x7A0B;&#x901A;&#x4FE1;&#x624B;&#x6BB5;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;&#xFF1A;
1&#x3001;&#x7BA1;&#x9053; ; 2&#x3001;&#x6D88;&#x606F;&#x961F;&#x5217;; 3&#x3001;&#x5171;&#x4EAB;&#x5185;&#x5B58;; 4&#x3001;&#x5957;&#x63A5;&#x5B57;;  5&#x3001;&#x4FE1;&#x53F7;&#x91CF;&#x3002;

Linux &#x5DF2;&#x7ECF;&#x6709;&#x591A;&#x79CD;&#x8DE8;&#x8FDB;&#x7A0B;&#x901A;&#x4FE1;&#x65B9;&#x5F0F;&#xFF0C;Android&#x57FA;&#x4E8E;Linux&#x7684;&#xFF0C;Android&#x4E3A;&#x4F55;&#x8FD8;&#x8981;&#x91C7;&#x7528;Binder&#xFF1F;
&#x6CE8;&#xFF1A;( Binder &#x4E0D;&#x662F;Android&#x63D0;&#x51FA;&#x6765;&#x7684;&#x4E00;&#x5957;&#x65B0;&#x7684;&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;&#x673A;&#x5236;&#xFF0C;&#x5B83;&#x662F;&#x57FA;&#x4E8E;OpenBinder&#x5B9E;&#x73B0;&#x7684;)

&#x8FD9;&#x662F;&#x4E3B;&#x8981;&#x4ECE;&#x4EE5;&#x4E0B;&#x51E0;&#x4E2A;&#x539F;&#x56E0;&#x8003;&#x8651;&#x7684;&#xFF1A;
1&#x3001;&#x6548;&#x7387;&#x3002;
&#x5BF9;&#x4E8E;&#x6D88;&#x606F;&#x961F;&#x5217;&#x3001; Socket &#x548C;  &#x7BA1;&#x9053;&#x6765;&#x8BF4;&#xFF0C; 
&#x6570;&#x636E;&#x5148;&#x4ECE;&#x53D1;&#x9001;&#x65B9;&#x7684;&#x7F13;&#x5B58;&#x533A;&#x62F7;&#x8D1D;&#x5230;&#x5185;&#x6838;&#x5F00;&#x8F9F;&#x7684;&#x7F13;&#x5B58;&#x533A;&#x4E2D;&#xFF0C;
&#x518D;&#x4ECE;&#x5185; &#x6838;&#x7F13;&#x5B58;&#x533A;&#x62F7;&#x8D1D;&#x5230;&#x63A5;&#x6536;&#x65B9;&#x7684;&#x7F13;&#x5B58;&#x533A;&#xFF0C;&#x4E00;&#x5171;&#x4E24;&#x6B21;&#x62F7;&#x8D1D;&#x3002;

2&#x3001;&#x7A33;&#x5B9A;&#x6027;
&#x56E0;&#x4E3A;&#x5171;&#x4EAB;&#x5185;&#x5B58;&#x9700;&#x8981;&#x5904;&#x7406;&#x5E76;&#x53D1;&#x540C;&#x6B65;&#x95EE;&#x9898;&#xFF0C;&#x5BB9;&#x6613;&#x51FA;&#x73B0;&#x6B7B;&#x9501;&#x548C;&#x8D44;&#x6E90;&#x7ADE;&#x4E89;&#xFF0C;&#x7A33;&#x5B9A;&#x6027;&#x8F83;&#x5DEE;&#x3002;

3&#x3001;&#x5B89;&#x5168;&#x6027;
&#x4F20;&#x7EDF; Linux IPC &#x7684;&#x63A5;&#x6536;&#x65B9;&#x65E0;&#x6CD5;&#x83B7;&#x5F97;&#x5BF9;&#x65B9;&#x8FDB;&#x7A0B;&#x53EF;&#x9760;&#x7684; UID/PID&#xFF0C;&#x4ECE;&#x800C;&#x65E0;&#x6CD5;&#x9274;&#x522B;&#x5BF9;&#x65B9;&#x8EAB;&#x4EFD;&#x3002;
&#x800C; binder&#x65B9;&#x5F0F;&#x505A;&#x4E86;&#x6539;&#x8FDB;&#xFF0C;&#x5EFA;&#x7ACB;&#x79C1;&#x6709;&#x901A;&#x9053;&#xFF0C;&#x66F4;&#x5B89;&#x5168;&#x3002;
</code></pre>
<table>
<thead>
<tr>
<th>&#x65B9;&#x5F0F;</th>
<th>&#x7F3A;&#x70B9;</th>
<th>&#x4F18;&#x70B9;</th>
<th>&#x6570;&#x636E;&#x62F7;&#x8D1D;&#x6B21;&#x6570;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x5171;&#x4EAB;&#x5185;&#x5B58;</td>
<td>&#x63A7;&#x5236;&#x673A;&#x5236;&#x590D;&#x6742;</td>
<td></td>
<td>0</td>
</tr>
<tr>
<td>Binder</td>
<td></td>
<td>&#x53EF;&#x4EE5;&#x5EFA;&#x7ACB;&#x79C1;&#x6709;&#x901A;&#x9053;&#x3001;&#x6709;UID&#x9274;&#x522B;&#x8EAB;&#x4EFD;</td>
<td>1</td>
</tr>
<tr>
<td>socket</td>
<td>&#x5F00;&#x9500;&#x5927;&#x3001;&#x6548;&#x7387;&#x4F4E;</td>
<td></td>
<td>2</td>
</tr>
<tr>
<td>&#x7BA1;&#x9053;&#x3001;&#x6D88;&#x606F;&#x961F;&#x5217;</td>
<td>&#x6548;&#x7387;&#x4F4E;</td>
<td></td>
<td>2</td>
</tr>
</tbody>
</table>
<h2 id="binder-&#x67B6;&#x6784;"><a name="binder-&#x67B6;&#x6784;" class="anchor-navigation-ex-anchor" href="#binder-&#x67B6;&#x6784;"><i class="fa fa-link" aria-hidden="true"></i></a>1.2. Binder &#x67B6;&#x6784;</h2>
<pre><code class="lang-text">Binder&#x662F;&#x4E00;&#x79CD;&#x67B6;&#x6784; ,&#x5B9A;&#x4E49;&#x4E86;&#x4E00;&#x79CD;&#x901A;&#x4FE1;&#x673A;&#x5236;&#x3002;
&#x8FD9;&#x79CD;&#x67B6;&#x6784;&#x63D0;&#x4F9B;&#x4E86; &#x670D;&#x52A1;&#x7AEF;&#x63A5;&#x53E3;&#x3001;Binder&#x9A71;&#x52A8;&#x3001;&#x5BA2;&#x6237;&#x7AEF;&#x63A5;&#x53E3; &#x4E09;&#x4E2A;&#x6A21;&#x5757;&#x3002;

Binder&#x4F7F;&#x7528; Client-Server &#x901A;&#x4FE1;&#x65B9;&#x5F0F; (C/S&#x67B6;&#x6784;)&#xFF0C;&#x5B89;&#x5168;&#x6027;&#x597D;&#xFF0C;&#x7B80;&#x5355;&#x9AD8;&#x6548;&#xFF0C;&#x518D;&#x52A0;&#x4E0A;&#x5176;&#x9762;&#x5411;&#x5BF9;&#x8C61;&#x7684;&#x8BBE;&#x8BA1;&#x601D;&#x60F3;&#xFF0C;
&#x72EC;&#x7279;&#x7684;&#x63A5;&#x6536;&#x7F13;&#x5B58;&#x7BA1;&#x7406;&#x548C;&#x7EBF;&#x7A0B;&#x6C60;&#x7BA1;&#x7406;&#x65B9;&#x5F0F;&#xFF0C;&#x6210;&#x4E3A;Android&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;&#x7684;&#x4E2D;&#x6D41;&#x7825;&#x67F1;&#x3002;

Binder&#x7684;&#x901A;&#x4FE1;&#x6A21;&#x578B;&#x6709;4&#x4E2A;&#x89D2;&#x8272;&#xFF1A;
Binder Client &#x3001;Binder Server &#x3001;ServiceManager &#x3001;Binder Driver  

&#x8FD9;4&#x4E2A;&#x89D2;&#x8272;&#x7684;&#x5173;&#x7CFB;&#x548C;&#x4E92;&#x8054;&#x7F51;&#x7C7B;&#x4F3C;&#xFF1A;
Server &#x662F;&#x670D;&#x52A1;&#x5668;&#xFF0C;Client &#x662F;&#x5BA2;&#x6237;&#x7EC8;&#x7AEF;&#xFF0C;
ServiceManager &#x662F;&#x57DF;&#x540D;&#x670D;&#x52A1;&#x5668; &#xFF0C;Binder Driver &#x662F;&#x8DEF;&#x7531;&#x5668;&#x3002;
</code></pre>
<h3 id="binder-client"><a name="binder-client" class="anchor-navigation-ex-anchor" href="#binder-client"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.1. Binder Client</h3>
<pre><code class="lang-text">&#x4F7F;&#x7528;&#x6570;&#x636E;&#x3002;
&#x8C03;&#x7528;&#x5176;&#x4ED6;&#x8FDB;&#x7A0B;&#x4E2D;&#x7684;&#x76F8;&#x5173;&#x670D;&#x52A1;&#x3002;&#x7531;&#x5F00;&#x53D1;&#x8005;&#x5B9E;&#x73B0;&#x3002;
</code></pre>
<h3 id="binder-server"><a name="binder-server" class="anchor-navigation-ex-anchor" href="#binder-server"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.2. Binder Server</h3>
<pre><code class="lang-text">&#x63D0;&#x4F9B;&#x6570;&#x636E; &#x3002;
&#x63D0;&#x4F9B;&#x76F8;&#x5173;&#x7684;&#x670D;&#x52A1;&#x3002;&#x7531;&#x5F00;&#x53D1;&#x8005;&#x5B9E;&#x73B0;&#x3002;
</code></pre>
<h3 id="servicemanager"><a name="servicemanager" class="anchor-navigation-ex-anchor" href="#servicemanager"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.3. ServiceManager</h3>
<pre><code class="lang-text">&#x63D0;&#x4F9B;&#x4E86; &#x67E5;&#x8BE2;&#x670D;&#x52A1; &#x548C; &#x6CE8;&#x518C;&#x670D;&#x52A1; &#x7684;&#x529F;&#x80FD;&#x3002;
Android&#x7CFB;&#x7EDF;&#x5DF2;&#x7ECF;&#x5B9E;&#x73B0;&#x3002; 
Service Manager&#x662F;&#x4E00;&#x4E2A;&#x5B88;&#x62A4;&#x8FDB;&#x7A0B;&#x3002;
</code></pre>
<h3 id="binder-driver"><a name="binder-driver" class="anchor-navigation-ex-anchor" href="#binder-driver"><i class="fa fa-link" aria-hidden="true"></i></a>1.2.4. Binder Driver</h3>
<pre><code class="lang-text">Binder &#x9A71;&#x52A8;&#xFF0C;&#x5C06;&#x6570;&#x636E;&#x4ECE;&#x8FDB;&#x7A0B;B&#x7684;&#x7528;&#x6237;&#x7A7A;&#x95F4;&#x4E2D;&#x62F7;&#x8D1D;&#x5230;&#x8FDB;&#x7A0B;A&#x7684;&#x7528;&#x6237;&#x7A7A;&#x95F4;&#x3002;
&#x5C3D;&#x7BA1;&#x540D;&#x53EB;&#x201C;&#x9A71;&#x52A8;&#x201D; &#xFF0C;&#x5B9E;&#x9645;&#x4E0A;&#x548C;&#x786C;&#x4EF6;&#x8BBE;&#x5907;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x5173;&#x7CFB;&#xFF0C;
&#x5B58;&#x5728;&#x4E8E;&#x5185;&#x6838;&#x7A7A;&#x95F4;&#x4E2D;&#x3002;Android&#x7CFB;&#x7EDF;&#x5DF2;&#x7ECF;&#x5B9E;&#x73B0;&#x3002;
</code></pre>
<p><img src="../pics/201802231617_osChina_Binder&#x67B6;&#x6784;&#x793A;&#x610F;&#x56FE;.png" alt=""></p>
<h1 id="&#x76F8;&#x5173;-&#x7C7B;&#x3001;&#x65B9;&#x6CD5;-&#x3001;&#x6982;&#x5FF5;"><a name="&#x76F8;&#x5173;-&#x7C7B;&#x3001;&#x65B9;&#x6CD5;-&#x3001;&#x6982;&#x5FF5;" class="anchor-navigation-ex-anchor" href="#&#x76F8;&#x5173;-&#x7C7B;&#x3001;&#x65B9;&#x6CD5;-&#x3001;&#x6982;&#x5FF5;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x76F8;&#x5173; &#x7C7B;&#x3001;&#x65B9;&#x6CD5; &#x3001;&#x6982;&#x5FF5;</h1>
<pre><code class="lang-text">1&#x3001;Native&#x7AEF;&#xFF1A;
IBinder &#x3001;BBinder &#x3001;BpBinder &#x3001;IPCThread &#x3001;ProcessState&#x3001;IInterface &#x3001;JavaBBinder

jni&#x7AEF;&#xFF1A;
android_util_Binder.cpp

2&#x3001;Java&#x7AEF;&#xFF1A;
IBinder &#x3001; Binder&#x3001;BinderProxy&#xFF08;Binder&#x7684;&#x4E00;&#x4E2A;&#x5185;&#x90E8;&#x7C7B;&#xFF09;&#x3001; 
Stub&#x3001; Proxy &#x3001;ServiceManager&#xFF08;Java&#x6E90;&#x7801; &#x88AB;@hide&#x4E86;&#xFF09;

3&#x3001;Binder Driver &#x7AEF;&#xFF1A;
binder_proc&#x3001; binder_thread&#x3001; binder_node &#x3001;ioctl&#xFF08;&#x662F;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF09;
</code></pre>
<h2 id="binder&#x5B9E;&#x4F53;"><a name="binder&#x5B9E;&#x4F53;" class="anchor-navigation-ex-anchor" href="#binder&#x5B9E;&#x4F53;"><i class="fa fa-link" aria-hidden="true"></i></a>2.1. Binder&#x5B9E;&#x4F53;</h2>
<p>&#x662F; binder_node&#x7ED3;&#x6784;&#x4F53;&#x7684;&#x5BF9;&#x8C61;&#x3002;</p>
<h2 id="&#x5B9E;&#x540D;-binder"><a name="&#x5B9E;&#x540D;-binder" class="anchor-navigation-ex-anchor" href="#&#x5B9E;&#x540D;-binder"><i class="fa fa-link" aria-hidden="true"></i></a>2.2. &#x5B9E;&#x540D; Binder</h2>
<p>&#x6CE8;&#x518C;&#x4E86;&#x540D;&#x5B57;&#x7684;Binder&#x3002;</p>
<h2 id="&#x533F;&#x540D;-binder"><a name="&#x533F;&#x540D;-binder" class="anchor-navigation-ex-anchor" href="#&#x533F;&#x540D;-binder"><i class="fa fa-link" aria-hidden="true"></i></a>2.3. &#x533F;&#x540D; Binder</h2>
<pre><code class="lang-text">Server &#x7AEF;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5DF2;&#x7ECF;&#x5EFA;&#x7ACB;&#x7684; Binder &#x8FDE;&#x63A5;&#x5C06;&#x521B;&#x5EFA;&#x7684; Binder &#x5B9E;&#x4F53;&#x4F20;&#x7ED9; Client &#x3002;
&#x7531;&#x4E8E;&#x8FD9;&#x4E2A; Binder &#x6CA1;&#x6709;&#x5411; ServiceManager &#x6CE8;&#x518C;&#x540D;&#x5B57;&#xFF0C;&#x6240;&#x4EE5;&#x662F;&#x4E2A;&#x533F;&#x540D;Binder&#x3002; 

&#x533F;&#x540D;Binder &#x4E3A;&#x901A;&#x4FE1;&#x53CC;&#x65B9;&#x5EFA;&#x7ACB;&#x4E00;&#x6761;&#x79C1;&#x5BC6;&#x901A;&#x9053;&#xFF0C;&#x53EA;&#x8981; Server &#x6CA1;&#x6709;&#x628A;&#x533F;&#x540D;Binder&#x53D1;&#x7ED9;&#x522B;&#x7684;&#x8FDB;&#x7A0B;&#xFF0C;
&#x522B;&#x7684;&#x8FDB;&#x7A0B;&#x5C31;&#x65E0;&#x6CD5;&#x901A;&#x8FC7;&#x7A77;&#x4E3E;&#x6216;&#x731C;&#x6D4B;&#x7B49;&#x4EFB;&#x4F55;&#x65B9;&#x5F0F;&#x83B7;&#x5F97;&#x8BE5;Binder&#x7684;&#x5F15;&#x7528;&#x3002;
</code></pre>
<h2 id="binder&#x5F15;&#x7528;"><a name="binder&#x5F15;&#x7528;" class="anchor-navigation-ex-anchor" href="#binder&#x5F15;&#x7528;"><i class="fa fa-link" aria-hidden="true"></i></a>2.4. Binder&#x5F15;&#x7528;</h2>
<p>&#x6BCF;&#x4E00;&#x4E2A;Binder&#x5F15;&#x7528;&#x90FD;&#x662F;&#x67D0;&#x4E00;&#x4E2A;Binder&#x5B9E;&#x4F53;&#x7684;&#x5F15;&#x7528;&#x3002;</p>
<h2 id="0&#x53F7;&#x5F15;&#x7528;"><a name="0&#x53F7;&#x5F15;&#x7528;" class="anchor-navigation-ex-anchor" href="#0&#x53F7;&#x5F15;&#x7528;"><i class="fa fa-link" aria-hidden="true"></i></a>2.5. 0&#x53F7;&#x5F15;&#x7528;</h2>
<pre><code class="lang-text">&#x6211;&#x4EEC;&#x53EF;&#x80FD;&#x4F1A;&#x53D1;&#x73B0;&#x4E00;&#x4E2A;&#x7EC6;&#x8282;&#xFF1A;
ServiceManager &#x662F;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#xFF0C;Server &#x662F;&#x53E6;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B; &#xFF0C;
Server&#x5411; ServiceManager &#x6CE8;&#x518C; Binder &#x5FC5;&#x7136;&#x4F1A;&#x6D89;&#x53CA;&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;&#x3002;

&#x5F53;&#x524D;&#x5B9E;&#x73B0;&#x7684;&#x662F;&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;&#x5374;&#x53C8;&#x8981;&#x7528;&#x5230;&#x8FDB;&#x7A0B;&#x95F4;&#x901A;&#x4FE1;&#xFF0C;&#x8FD9;&#x5C31;&#x597D;&#x8C61;&#x86CB;&#x53EF;&#x4EE5;&#x5B75;&#x51FA;&#x9E21;&#x524D;&#x63D0;&#x5374;&#x662F;&#x8981;&#x627E;&#x53EA;&#x9E21;&#x6765;&#x5B75;&#x86CB;&#x3002; 
Binder &#x7684;&#x5B9E;&#x73B0;&#x6BD4;&#x8F83;&#x5DE7;&#x5999;&#xFF1A;&#x7CFB;&#x7EDF;&#x7ED9; ServiceManager &#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7279;&#x6B8A;&#x4E13;&#x95E8;&#x7684; Binder&#x5B9E;&#x4F53;&#x3002; 
&#x5B83;&#x6CA1;&#x6709;&#x540D;&#x5B57;&#x4E5F;&#x4E0D;&#x9700;&#x8981;&#x6CE8;&#x518C;&#x3002;
&#x4E00;&#x4E2A; Server &#x82E5;&#x8981;&#x5411; ServiceManager &#x6CE8;&#x518C;&#x81EA;&#x5DF1; Binder &#x5C31;&#x5FC5;&#x9700;&#x901A;&#x8FC7;0&#x8FD9;&#x4E2A;&#x5F15;&#x7528;&#x53F7;&#x548C; ServiceManager &#x7684;Binder&#x901A;&#x4FE1;&#x3002;
</code></pre>
<h1 id="&#x4E3A;&#x4EC0;&#x4E48;binder&#x53EA;&#x8FDB;&#x884C;&#x4E86;&#x4E00;&#x6B21;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#xFF1F;-&#x3001;mmap"><a name="&#x4E3A;&#x4EC0;&#x4E48;binder&#x53EA;&#x8FDB;&#x884C;&#x4E86;&#x4E00;&#x6B21;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#xFF1F;-&#x3001;mmap" class="anchor-navigation-ex-anchor" href="#&#x4E3A;&#x4EC0;&#x4E48;binder&#x53EA;&#x8FDB;&#x884C;&#x4E86;&#x4E00;&#x6B21;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#xFF1F;-&#x3001;mmap"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x4E3A;&#x4EC0;&#x4E48;Binder&#x53EA;&#x8FDB;&#x884C;&#x4E86;&#x4E00;&#x6B21;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#xFF1F; &#x3001;mmap()</h1>
<pre><code class="lang-text">&#x5148;&#x628A;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#x5230;&#x5185;&#x6838;&#x7684;&#x7F13;&#x5B58;&#x533A;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x4ECE;&#x5185;&#x6838;&#x7684;&#x7F13;&#x5B58;&#x533A;&#x62F7;&#x8D1D;&#x7ED9;&#x63A5;&#x6536;&#x65B9;&#x3002;
&#x8FD9;&#x6837;&#x505A;&#x4F1A;&#x4EA7;&#x751F;&#x4E24;&#x6B21;&#x6570;&#x636E;&#x7684;&#x62F7;&#x8D1D;&#x3002;
linux&#x4E2D;&#x7684;&#x7BA1;&#x9053;&#x901A;&#x4FE1;&#x5C31;&#x662F;&#x91C7;&#x53D6;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x3002;

&#x4F46;&#x662F; binder &#x8FDB;&#x4E00;&#x6B65;&#x4F18;&#x5316;&#xFF0C;
&#x6570;&#x636E;&#x4ECE; &#x53D1;&#x9001;&#x65B9;&#x7684;&#x7F13;&#x5B58;&#x533A; &#x62F7;&#x8D1D;&#x5230;&#x5185;&#x6838;&#x7684;&#x7F13;&#x5B58;&#x533A;&#xFF0C;
&#x800C; &#x63A5;&#x6536;&#x65B9;&#x7684;&#x7F13;&#x5B58;&#x533A; &#x4E0E;&#x5185;&#x6838;&#x7684;&#x7F13;&#x5B58;&#x533A;&#x88AB;&#x662F;&#x6620;&#x5C04;&#x5230;&#x540C;&#x4E00;&#x5757;&#x7269;&#x7406;&#x5730;&#x5740;&#x7684;&#xFF0C;&#x56E0;&#x6B64;&#x53EA;&#x9700;&#x8981;&#x4E00;&#x6B21;&#x62F7;&#x8D1D;&#x5373;&#x53EF;&#x3002;

mmap() &#x5206;&#x914D;&#x7684;&#x5185;&#x5B58;&#x9664;&#x4E86;&#x6620;&#x5C04;&#x8FDB;&#x4E86;&#x63A5;&#x6536;&#x65B9;&#x8FDB;&#x7A0B;&#x91CC;&#xFF0C;&#x8FD8;&#x6620;&#x5C04;&#x8FDB;&#x4E86;&#x5185;&#x6838;&#x7A7A;&#x95F4;&#x3002;
&#x6240;&#x4EE5;&#x8C03;&#x7528; copy_from_user() &#x5C06;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#x8FDB;&#x5185;&#x6838;&#x7A7A;&#x95F4;&#x4E5F;&#x76F8;&#x5F53;&#x4E8E;&#x62F7;&#x8D1D;&#x8FDB;&#x4E86;&#x63A5;&#x6536;&#x65B9;&#x7684;&#x7528;&#x6237;&#x7A7A;&#x95F4; &#x3002;
</code></pre>
<p><img src="../pics/201802231617_osChina_Binder&#x901A;&#x4FE1;&#x793A;&#x610F;&#x56FE;.png" alt=""></p>
<h1 id="binder-&#x600E;&#x4E48;&#x9A8C;&#x8BC1;-pid---&#x6BD4;&#x4F20;&#x7EDF;-&#x9A8C;&#x8BC1;&#x65B9;&#x5F0F;-&#x66F4;&#x5B89;&#x5168;"><a name="binder-&#x600E;&#x4E48;&#x9A8C;&#x8BC1;-pid---&#x6BD4;&#x4F20;&#x7EDF;-&#x9A8C;&#x8BC1;&#x65B9;&#x5F0F;-&#x66F4;&#x5B89;&#x5168;" class="anchor-navigation-ex-anchor" href="#binder-&#x600E;&#x4E48;&#x9A8C;&#x8BC1;-pid---&#x6BD4;&#x4F20;&#x7EDF;-&#x9A8C;&#x8BC1;&#x65B9;&#x5F0F;-&#x66F4;&#x5B89;&#x5168;"><i class="fa fa-link" aria-hidden="true"></i></a>4. binder &#x600E;&#x4E48;&#x9A8C;&#x8BC1; pid  ( &#x6BD4;&#x4F20;&#x7EDF; &#x9A8C;&#x8BC1;&#x65B9;&#x5F0F; &#x66F4;&#x5B89;&#x5168;)</h1>
<pre><code class="lang-text">&#x4F20;&#x7EDF; Linux IPC &#x7684;&#x63A5;&#x6536;&#x65B9;&#x65E0;&#x6CD5;&#x83B7;&#x5F97;&#x5BF9;&#x65B9;&#x8FDB;&#x7A0B;&#x53EF;&#x9760;&#x7684; UID/PID&#xFF0C;&#x4ECE;&#x800C;&#x65E0;&#x6CD5;&#x9274;&#x522B;&#x5BF9;&#x65B9;&#x8EAB;&#x4EFD;&#x3002;

pid &#x9A8C;&#x8BC1;&#x6D41;&#x7A0B; &#x6682;&#x65F6;&#x8FD8;&#x672A;&#x5B66;&#x4E60;&#x3002;
</code></pre>
<h1 id="binder&#x901A;&#x4FE1;&#x547D;&#x4EE4;&#x5B57;"><a name="binder&#x901A;&#x4FE1;&#x547D;&#x4EE4;&#x5B57;" class="anchor-navigation-ex-anchor" href="#binder&#x901A;&#x4FE1;&#x547D;&#x4EE4;&#x5B57;"><i class="fa fa-link" aria-hidden="true"></i></a>5. Binder&#x901A;&#x4FE1;&#x547D;&#x4EE4;&#x5B57;</h1>
<pre><code class="lang-text">BINDER_WRITE_READ |&#x8BE5;&#x547D;&#x4EE4;&#x5411;Binder&#x5199;&#x5165;&#x6216;&#x8BFB;&#x53D6;&#x6570;&#x636E; 
BINDER_SET_MAX_THREADS |&#x8BE5;&#x547D;&#x4EE4;&#x544A;&#x77E5;Binder&#x9A71;&#x52A8;&#x63A5;&#x6536;&#x65B9;&#x7EBF;&#x7A0B;&#x6C60;&#x4E2D;&#x6700;&#x5927;&#x7684;&#x7EBF;&#x7A0B;&#x6570; 
BINDER_SET_CONTEXT_MGR|&#x5C06;&#x5F53;&#x524D;&#x8FDB;&#x7A0B;&#x6CE8;&#x518C;&#x4E3A;SMgr&#x3002; 
BINDER_THREAD_EXIT|&#x901A;&#x77E5;Binder&#x9A71;&#x52A8;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#x9000;&#x51FA;&#x4E86;&#x3002; 
BINDER_VERSION|&#x83B7;&#x5F97;Binder&#x9A71;&#x52A8;&#x7684;&#x7248;&#x672C;&#x53F7; 

BC_TRANSACTION|Client&#x5411;Server&#x53D1;&#x9001;&#x8BF7;&#x6C42;&#x6570;&#x636E; 
BC_REPLY|Server&#x5411;Client&#x53D1;&#x9001;&#x56DE;&#x590D;&#x6570;&#x636E; 
BC_ACQUIRE_RESULT&#x3001; 
BC_ATTEMPT_ACQUIRE 
BC_FREE_BUFFER| &#x91CA;&#x653E;&#x4E00;&#x5757;&#x6620;&#x5C04;&#x7684;&#x5185;&#x5B58; 
BC_INCREFS&#x3001;BC_ACQUIRE &#x3001;BC_RELEASE &#x3001;BC_DECREFS|&#x589E;&#x52A0;&#x6216;&#x51CF;&#x5C11;Binder&#x7684;&#x5F15;&#x7528;&#x8BA1;&#x6570;  
BC_INCREFS_DONE &#x3001;BC_ACQUIRE_DONE|&#x5904;&#x7406;&#x5B8C;&#x6BD5;&#x53CD;&#x9988;&#x4FE1;&#x606F;  
BC_REGISTER_LOOPER|&#x901A;&#x77E5;&#x9A71;&#x52A8;&#x7EBF;&#x7A0B;&#x6C60;&#x4E2D;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x5DF2;&#x7ECF;&#x521B;&#x5EFA;&#x4E86; 
BC_ENTER_LOOPER|&#x901A;&#x77E5;&#x9A71;&#x52A8;&#x8BE5;&#x7EBF;&#x7A0B;&#x5DF2;&#x7ECF;&#x8FDB;&#x5165;&#x4E3B;&#x5FAA;&#x73AF;&#xFF0C;&#x53EF;&#x4EE5;&#x63A5;&#x6536;&#x6570;&#x636E;  
BC_EXIT_LOOPER|&#x901A;&#x77E5;&#x9A71;&#x52A8;&#x8BE5;&#x7EBF;&#x7A0B;&#x9000;&#x51FA;&#x4E3B;&#x5FAA;&#x73AF;&#xFF0C;&#x4E0D;&#x518D;&#x63A5;&#x6536;&#x6570;&#x636E; 
BC_REQUEST_DEATH_NOTIFICATION| &#x8981;&#x6C42;&#x9A71;&#x52A8;&#x5728;Binder&#x5B9E;&#x4F53;&#x9500;&#x6BC1;&#x5F97;&#x5230;&#x901A;&#x77E5; 
BC_DEAD_BINDER_DONE|&#x6536;&#x5230;&#x9500;&#x6BC1;&#x901A;&#x77E5;&#x7684;&#x8FDB;&#x7A0B;&#x5728;&#x5220;&#x9664;&#x5F15;&#x7528;&#x540E;&#x7528;&#x672C;&#x547D;&#x4EE4;&#x544A;&#x77E5;&#x9A71;&#x52A8; 

BR_ERROR|&#x53D1;&#x751F;&#x5185;&#x90E8;&#x9519;&#x8BEF; 
BR_OK &#x3001;BR_NOOP|&#x64CD;&#x4F5C;&#x5B8C;&#x6210; 
BR_SPAWN_LOOPER|&#x5411;&#x63A5;&#x6536;&#x65B9;&#x53D1;&#x9001;&#x8BE5;&#x547D;&#x4EE4;&#x8981;&#x6C42;&#x521B;&#x5EFA;&#x66F4;&#x591A;&#x7EBF;&#x7A0B;&#x4EE5;&#x5907;&#x63A5;&#x6536;&#x6570;&#x636E; 
BR_TRANSACTION &#x3001;BR_REPLY|&#x8868;&#x793A;&#x5F53;&#x524D;&#x63A5;&#x6536;&#x7684;&#x6570;&#x636E;&#x662F;&#x8BF7;&#x6C42;&#x8FD8;&#x662F;&#x56DE;&#x590D;
BR_ACQUIRE_RESULT &#x3001;BR_ATTEMPT_ACQUIRE &#x3001;BR_FINISHED
BR_DEAD_REPLY|&#x4EA4;&#x4E92;&#x8FC7;&#x7A0B;&#x4E2D;&#x5982;&#x679C;&#x53D1;&#x73B0;&#x5BF9;&#x65B9;&#x8FDB;&#x7A0B;&#x6216;&#x7EBF;&#x7A0B;&#x5DF2;&#x7ECF;&#x6B7B;&#x4EA1;&#x5219;&#x8FD4;&#x56DE;&#x8BE5;&#x6D88;&#x606F;
BR_TRANSACTION_COMPLETE|&#x53D1;&#x9001;&#x6570;&#x636E;&#x5305;&#x540E;&#xFF0C;&#x6536;&#x5230;&#x8BE5;&#x6D88;&#x606F;&#x505A;&#x4E3A;&#x6210;&#x529F;&#x53D1;&#x9001;&#x7684;&#x53CD;&#x9988;
BR_INCREFS &#x3001;BR_ACQUIRE &#x3001;BR_RELEASE &#x3001;BR_DECREFS|&#x7528;&#x4E8E;&#x7BA1;&#x7406;&#x5F3A;/&#x5F31;&#x6307;&#x9488;&#x7684;&#x5F15;&#x7528;&#x8BA1;&#x6570;
BR_DEAD_BINDER &#x3001;BR_CLEAR_DEATH_NOTIFICATION_DONE|&#x6536;&#x5230;&#x6B7B;&#x4EA1;&#x901A;&#x77E5;&#x4E66;
BR_FAILED_REPLY|&#x5982;&#x679C;&#x53D1;&#x9001;&#x975E;&#x6CD5;&#x5F15;&#x7528;&#x53F7;&#x5219;&#x8FD4;&#x56DE;&#x8BE5;&#x6D88;&#x606F;
</code></pre>
<h1 id="binder-&#x63A5;&#x6536;&#x53D1;&#x9001;-&#x6570;&#x636E;&#x5305;&#x7684;&#x6807;&#x51C6;&#x683C;&#x5F0F;"><a name="binder-&#x63A5;&#x6536;&#x53D1;&#x9001;-&#x6570;&#x636E;&#x5305;&#x7684;&#x6807;&#x51C6;&#x683C;&#x5F0F;" class="anchor-navigation-ex-anchor" href="#binder-&#x63A5;&#x6536;&#x53D1;&#x9001;-&#x6570;&#x636E;&#x5305;&#x7684;&#x6807;&#x51C6;&#x683C;&#x5F0F;"><i class="fa fa-link" aria-hidden="true"></i></a>6. Binder &#x63A5;&#x6536;/&#x53D1;&#x9001; &#x6570;&#x636E;&#x5305;&#x7684;&#x6807;&#x51C6;&#x683C;&#x5F0F;</h1>
<pre><code class="lang-text">union 
{ 
    size_t handle;void *ptr;
} target;
// &#x6307;&#x660E;&#x53D1;&#x9001;&#x76EE;&#x7684;&#x5730;


void *cookie;
&#x5B58;&#x653E;&#x7684;&#x662F;&#x521B;&#x5EFA;Binder&#x5B9E;&#x4F53;&#x65F6;&#x7531;&#x8BE5;&#x63A5;&#x6536;&#x65B9;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x4EFB;&#x610F;&#x6570;&#x503C;&#xFF0C;
&#x505A;&#x4E3A;&#x4E0E;Binder&#x6307;&#x9488;&#x76F8;&#x5173;&#x7684;&#x989D;&#x5916;&#x4FE1;&#x606F;&#x5B58;&#x653E;&#x5728;&#x9A71;&#x52A8;&#x4E2D;&#x3002;

unsigned int code;
&#x5B58;&#x653E;&#x6536;&#x53D1;&#x53CC;&#x65B9;&#x7EA6;&#x5B9A;&#x7684;&#x547D;&#x4EE4;&#x7801;

unsigned int flags;
&#x4E0E;&#x4EA4;&#x4E92;&#x76F8;&#x5173;&#x7684;&#x6807;&#x5FD7;&#x4F4D;

pid_t sender_pid;&#x3001;uid_t sender_euid;
&#x8BE5;&#x6210;&#x5458;&#x5B58;&#x653E;&#x53D1;&#x9001;&#x65B9;&#x7684;&#x8FDB;&#x7A0B;ID&#x548C;&#x7528;&#x6237;ID&#xFF0C;&#x7531;&#x9A71;&#x52A8;&#x8D1F;&#x8D23;&#x586B;&#x5165;

size_t data_size;
&#x7F13;&#x51B2;&#x533A;&#x5B58;&#x653E;&#x7684;&#x6570;&#x636E;&#x957F;&#x5EA6;&#x3002;
size_t offsets_size;
&#x504F;&#x79FB;&#x4F4D;&#x7F6E;

union { 
    struct { 
    const void buffer; 
    const void offsets; 
} ptr; 
 uint8_t buf[8]; 
} data;
// &#x653E;&#x8981;&#x53D1;&#x9001;&#x6216;&#x63A5;&#x6536;&#x5230;&#x7684;&#x6570;&#x636E;,
</code></pre>
<h1 id="&#x8865;&#x5145;&#x4E00;&#x4E9B;-&#x67B6;&#x6784;&#x56FE;"><a name="&#x8865;&#x5145;&#x4E00;&#x4E9B;-&#x67B6;&#x6784;&#x56FE;" class="anchor-navigation-ex-anchor" href="#&#x8865;&#x5145;&#x4E00;&#x4E9B;-&#x67B6;&#x6784;&#x56FE;"><i class="fa fa-link" aria-hidden="true"></i></a>7. &#x8865;&#x5145;&#x4E00;&#x4E9B; &#x67B6;&#x6784;&#x56FE;</h1>
<h2 id="binder-&#x901A;&#x4FE1;&#x6A21;&#x578B;&#x3001;-binder-&#x67B6;&#x6784;"><a name="binder-&#x901A;&#x4FE1;&#x6A21;&#x578B;&#x3001;-binder-&#x67B6;&#x6784;" class="anchor-navigation-ex-anchor" href="#binder-&#x901A;&#x4FE1;&#x6A21;&#x578B;&#x3001;-binder-&#x67B6;&#x6784;"><i class="fa fa-link" aria-hidden="true"></i></a>7.1. Binder &#x901A;&#x4FE1;&#x6A21;&#x578B;&#x3001; Binder &#x67B6;&#x6784;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231557_osChina_Binder&#x67B6;&#x6784;.jpg" alt=""></p>
<h2 id="binder-&#x673A;&#x5236;"><a name="binder-&#x673A;&#x5236;" class="anchor-navigation-ex-anchor" href="#binder-&#x673A;&#x5236;"><i class="fa fa-link" aria-hidden="true"></i></a>7.2. Binder &#x673A;&#x5236;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231558_osChina_Binder&#x673A;&#x5236;.jpg" alt=""></p>
<h2 id="binder-&#x9A71;&#x52A8;"><a name="binder-&#x9A71;&#x52A8;" class="anchor-navigation-ex-anchor" href="#binder-&#x9A71;&#x52A8;"><i class="fa fa-link" aria-hidden="true"></i></a>7.3. Binder &#x9A71;&#x52A8;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231558_osChina_Binder&#x9A71;&#x52A8;.jpg" alt=""></p>
<h2 id="binder-&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;"><a name="binder-&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#binder-&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>7.4. Binder &#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231559_osChina_Binder&#x8FDB;&#x7A0B;&#x4E0E;&#x7EBF;&#x7A0B;.jpg" alt=""></p>
<h2 id="servicemanager&#x542F;&#x52A8;"><a name="servicemanager&#x542F;&#x52A8;" class="anchor-navigation-ex-anchor" href="#servicemanager&#x542F;&#x52A8;"><i class="fa fa-link" aria-hidden="true"></i></a>7.5. ServiceManager&#x542F;&#x52A8;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231559_osChina_ServiceManager&#x542F;&#x52A8;.jpg" alt=""></p>
<h2 id="servicemanager-&#x6CE8;&#x518C;&#x670D;&#x52A1;"><a name="servicemanager-&#x6CE8;&#x518C;&#x670D;&#x52A1;" class="anchor-navigation-ex-anchor" href="#servicemanager-&#x6CE8;&#x518C;&#x670D;&#x52A1;"><i class="fa fa-link" aria-hidden="true"></i></a>7.6. ServiceManager &#x6CE8;&#x518C;&#x670D;&#x52A1;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231559_osChina_ServiceManager&#x6CE8;&#x518C;&#x670D;&#x52A1;.jpg" alt=""></p>
<h2 id="servicemanager-&#x83B7;&#x53D6;&#x670D;&#x52A1;"><a name="servicemanager-&#x83B7;&#x53D6;&#x670D;&#x52A1;" class="anchor-navigation-ex-anchor" href="#servicemanager-&#x83B7;&#x53D6;&#x670D;&#x52A1;"><i class="fa fa-link" aria-hidden="true"></i></a>7.7. ServiceManager &#x83B7;&#x53D6;&#x670D;&#x52A1;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231559_osChina_ServiceManager&#x83B7;&#x53D6;&#x670D;&#x52A1;.jpg" alt=""></p>
<h2 id="&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x5B8C;&#x6574;&#x901A;&#x8BAF;"><a name="&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x5B8C;&#x6574;&#x901A;&#x8BAF;" class="anchor-navigation-ex-anchor" href="#&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x5B8C;&#x6574;&#x901A;&#x8BAF;"><i class="fa fa-link" aria-hidden="true"></i></a>7.8. &#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x5B8C;&#x6574;&#x901A;&#x8BAF;</h2>
<p><img src="https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201802231600_osChina_Binder&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x5B8C;&#x6574;&#x901A;&#x8BAF;.jpg" alt=""></p>
<footer class="page-footer"><span class="copyright">( no Copyright&#xFF0C;enjoy youself ! ) all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">The file was updated at :
2022-04-04 10:49:02
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../通信方式/通信方式详解.html" class="navigation navigation-prev " aria-label="Previous page: 通信方式详解">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Handler详解.html" class="navigation navigation-next " aria-label="Next page: Handle详解">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Binder详解","level":"1.12.11","depth":2,"next":{"title":"Handle详解","level":"1.12.12","depth":2,"path":"chinese/android基础/Handler详解.md","ref":"chinese/android基础/Handler详解.md","articles":[]},"previous":{"title":"通信方式详解","level":"1.12.10","depth":2,"path":"chinese/通信方式/通信方式详解.md","ref":"chinese/通信方式/通信方式详解.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","search-plus","todo","anchor-navigation-ex","copy-code-button","fontsettings","tbfed-pagefooter","local-video","splitter","expandable-chapters","favicon","theme-comscore","local-video"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"( no Copyright，enjoy youself ! )","modify_label":"The file was updated at :","modify_format":"YYYY-MM-DD HH:mm:ss"},"todo":{},"splitter":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"family":"sans","size":2,"theme":"white"},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"favicon":{"shortcut":"assets/images/favicon.ico","bookmark":"assets/images/favicon.ico"},"theme-comscore":{},"local-video":{},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"Aivin","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Aivin开发笔记","language":"zh-hans","gitbook":"*","description":"Aivin开发笔记"},"file":{"path":"chinese/android基础/Binder详解.md","mtime":"2022-04-04T02:49:02.747Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-04-04T03:47:09.782Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

